import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    component: () => import('@/views/About.vue')
  },
  {
    path: '/child',
    name: 'ChildMain',
    redirect: '/child/sub1',
    component: () => import('@/views/ChildMain.vue'),
    children: [
      {
        path: 'sub1',
        name: 'ChildSub1',
        component: () => import('@/views/ChildSub1.vue'),
      },
      {
        path: 'sub2',
        name: 'ChildSub2',
        component: () => import('@/views/ChildSub2.vue'),
      }
    ]
  }
]


export default routes
